# @Time : 2020/6/25 14:58
# @Author : Fioman 
# @Phone : 13149920693
def factorial(n):
    """
    :param n:
    :return: n!
    """
    return 1 if n < 2 else factorial(n - 1) * n


print("factorial(42) = {}".format(factorial(42)))
print("factorial.__doc__ = {}".format(factorial.__doc__))
print("factorial.__name__ = {}".format(factorial.__name__))
print("type of factorial = {}".format(type(factorial)))

# 可以赋值给一个变量
fact = factorial
print("fact(42) = {}".format(fact(42)))
print("fact = {}".format(fact))
print("fact == factorial:{}".format(fact == factorial))

res = list(map(fact,range(11)))
print(res)